<%@page isELIgnored="false" pageEncoding="UTF-8" contentType="text/html; UTF-8" %>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>管理员</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
	<script src="${pageContext.request.contextPath}/js/jquery-1.12.4.js"></script>
	<script src="${pageContext.request.contextPath}/layui/layui.js"></script>
</head>
<body class="layui-layout-body">
	<div class="layui-row">
		<table id="adminList" lay-filter="adminList"></table>
	</div>
	<!--表格最右边编辑表格-->
	<script type="text/html" id="barDemo">
		<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
		<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
	</script>
	<%--表格 end--%>
</body>

	<script>
		layui.use(['form','table','layer'],function () {
			var table = layui.table;
			var form = layui.form;
			var layer = layui.layer;
			var upload = layui.upload;
			var $ = layui.$;
			/*显示表格所有内容*/
			table.render({
				elem: '#adminList'
				,height: 500
				,url: '${pageContext.request.contextPath}/admin/selectAll' //数据接口
				,limit:5   //默认每页三条数据,要求limit的值必须包含的limits中
				,limits:[5,10,15]
				,page: true //开启分页
				,toolbar: 'default' //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
				,totalRow: true //开启合计行
				,cols: [[ //表头
					{type:'checkbox'}
					,{field: 'id', title: '编号', width:75}
					,{field: 'username', title: '用户名', width:150}
					,{field: 'password', title: '密码', width:150}
				]]
			});

		})
	</script>
</html>